home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Grafik & Text & Film / Quark XTensions / Freeware Xtensions / Quark AppleScript Scripts / Scripts (text only) / Open to Page < prev    next >
Text File  |  1994-05-02  |  742b  |  32 lines

  1. --Copyright 1994 Quark, Inc.   All rights reserved.
  2.  
  3.  
  4. script OpenToPage
  5.     tell application "QuarkXPress™"
  6.         activate
  7.         set thefile to choose file of type {"XDOC", "XTMP"} with prompt "Select the QuarkXPress™ document to open."
  8.         display dialog "Open to page:" default answer 1 with icon note
  9.         set pagenumber to text returned of result as integer
  10.         open (thefile)
  11.         tell document 1
  12.             try
  13.                 if pagenumber < 1 then error
  14.                 show page pagenumber
  15.             on error
  16.                 display dialog "That page number does not exist." buttons {"Cancel"} default button 1 with icon stop
  17.                 activate
  18.                 return
  19.             end try
  20.         end tell
  21.         activate
  22.     end tell
  23. end script
  24.  
  25. tell application "QuarkXPress™"
  26.     activate
  27.     try
  28.         do script {OpenToPage}
  29.     on error
  30.     end try
  31. end tell
  32.